-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support in Set-GitHubContent to upload binary files #336
Support in Set-GitHubContent to upload binary files #336
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to the project @StanleyGoldman, and thanks for the idea and for the submission. You're off to a great start. I've provided some feedback for you to take a look at when you get a chance.
Thanks again.
@@ -322,7 +325,6 @@ filter Set-GitHubContent | |||
[string] $CommitMessage, | |||
|
|||
[Parameter( | |||
Mandatory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to remain mandatory in its own ParameterSet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a misunderstanding with how I phrased this. It does need to be in its own parameter set, but not at the exclusion of the other required information. For instance, in order to what repo we're changing the content of, we still need to have the information either in the Elements
parameter set or the Uri
parameter set.
Previously, Content
was being used with either of those parameter sets. Now you are introducing ContentPath
as an alternative to Content
. That means we're now exploded from 2 possible parameter sets to 4:
Elements
withContent
(maybe namedElementsContent
)Elements with
ContentPath(maybe named
ElementsContentPath`)Uri
withContent
(maybe namedUriContent
)Uri
withContentPath
(maybe namedUriContentPath
)
You should try running Get-Help -Name Set-GitHubContent
and look at the Syntax
section. That will show you the various parameter sets that PowerShell has understood from the authored code. If you look at that with what you've currently authored, you should see more clearly how your new Content
parameter set excludes the key information that we need, as well as prevents Content
and ContentPath
from being used when the repo information is provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at Get-GitHubEvent
. That's an example where we had to explode the number of ParameterSets in order to support both the Elements
and Uri
repo scenarios while still accurately separating out the different possible inputs for the method itself.
@@ -322,7 +325,6 @@ filter Set-GitHubContent | |||
[string] $CommitMessage, | |||
|
|||
[Parameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also want to allow this to be ValueFromPipeline
to enable the content to be piped directly into this method. That's certainly an optional change for this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to file an issue for this, or should I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not addressing this in this PR, then go ahead and open it up as a suggestion once this PR lands.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 14 days of this comment. |
Co-authored-by: Howard Wolosky <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @StanleyGoldman,
Thanks so much for these updates, and my sincerest apologies for such a long time to get back to you with a follow-up review. I completely missed when you pushed up fixes earlier.
The main feedback here is still around the ParameterSets. Take a look at my more detailed comment in the reactivated comment thread to see if that gives you the additional information that you need to get it fixed.
@@ -322,7 +325,6 @@ filter Set-GitHubContent | |||
[string] $CommitMessage, | |||
|
|||
[Parameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not addressing this in this PR, then go ahead and open it up as a suggestion once this PR lands.
@@ -322,7 +325,6 @@ filter Set-GitHubContent | |||
[string] $CommitMessage, | |||
|
|||
[Parameter( | |||
Mandatory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a misunderstanding with how I phrased this. It does need to be in its own parameter set, but not at the exclusion of the other required information. For instance, in order to what repo we're changing the content of, we still need to have the information either in the Elements
parameter set or the Uri
parameter set.
Previously, Content
was being used with either of those parameter sets. Now you are introducing ContentPath
as an alternative to Content
. That means we're now exploded from 2 possible parameter sets to 4:
Elements
withContent
(maybe namedElementsContent
)Elements with
ContentPath(maybe named
ElementsContentPath`)Uri
withContent
(maybe namedUriContent
)Uri
withContentPath
(maybe namedUriContentPath
)
You should try running Get-Help -Name Set-GitHubContent
and look at the Syntax
section. That will show you the various parameter sets that PowerShell has understood from the authored code. If you look at that with what you've currently authored, you should see more clearly how your new Content
parameter set excludes the key information that we need, as well as prevents Content
and ContentPath
from being used when the repo information is provided.
@@ -231,6 +231,9 @@ filter Set-GitHubContent | |||
.PARAMETER Content | |||
The new file content. | |||
|
|||
.PARAMETER ContentPath | |||
The local path to file content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local path to file content. | |
The local path to a file whose content should replace what is currently stored remotely in the repo at the Path location. |
@@ -322,7 +325,6 @@ filter Set-GitHubContent | |||
[string] $CommitMessage, | |||
|
|||
[Parameter( | |||
Mandatory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at Get-GitHubEvent
. That's an example where we had to explode the number of ParameterSets in order to support both the Elements
and Uri
repo scenarios while still accurately separating out the different possible inputs for the method itself.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 14 days of this comment. |
This pull request has been automatically closed due to a lack of activity from the author. We understand. Life happens and other things likely came up. We would still love to see your contribution get merged in. Now that it has been closed, a different community member may wish to pick up where you left off. If so, they should speak up by commenting below. If you're still interested in completing this yourself, just respond back and let us know. |
Description
As mentioned in #335, this pull request adds functionality to upload binary content with
Set-GitHubContent
Issues Fixed
References
Checklist